<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
//		var ob = {};
		var ar = [];
		ar["a"] = "aa";
		
		ar["b"] = "bb";
		ar["c"] = "cc";
		
		for(var i=0; i<ar.length; i++){
			console.log(ar[i])
		}
		
//		console.log(JSON.stringify(ob))
//		console.log(JSON.stringify(ar))
		
		//////////////////////////////////////////
			var b = [2,3,4,5,12,3,45,6,34,5,6,76,7,6,7,"wde",234,8];
			var dd = formatChartData(b);
//			console.log(JSON.stringify(dd))
			
			
			function formatChartData(data){
				var initNum = 2;
				var formatArr = null;
				if(data[0].format){
				    formatArr = JSON.parse(data[0].format);
				}
				
				var result = [];
				var temp = [];
				var j = 0;
				var num = initNum;
				if(formatArr && formatArr[j]){
					num = formatArr[j];
				}
				for (i=0;i<data.length;i++) {
					temp.push(data[i]);
					if(temp.length==num || i==data.length-1){
						result.push(temp);
						temp = [];
						j++;
						if(formatArr && formatArr[j]){
							num = formatArr[j];
						}else{
							num = initNum;
						}
					}
				}
				return result;
			}//end
			
			
			
		</script>
		
	</body>
</html>
